<?php

class ActivityService extends AbstractService
{

    protected function _init()
    {
	$this->setMapper(new ActivityMapper());
    }

    public function getAll()
    {
	$cacheSlot = new CacheSlotsActivityList();
	if (($activityList = $cacheSlot->load()) === false) {
	    $data = $this->getMapper()->getAll();
	    $activityList = array();
	    if ($data) {
		foreach ($data as $activity) {
		    $activityList[$activity->getId()] = $activity->getDbData('name');
		}
	    }
	    $cacheSlot->setData($activityList)->save();
	}
	return $activityList;
    }

}

?>
